<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title> - 联系人</title>
    <meta name="keywords" content="">
    <meta name="description" content="">
    <link rel="shortcut icon" href="__PUBLIC__/admin/favicon.ico">
    <link href="__PUBLIC__/admin/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="__PUBLIC__/admin/css/font-awesome.min.css?v=4.4.0" rel="stylesheet">
    <link href="__PUBLIC__/admin/css/animate.css" rel="stylesheet">
    <link href="__PUBLIC__/admin/css/style.css?v=4.1.0" rel="stylesheet">
    <link href="__PUBLIC__/admin/css/laydate/laydate.css" rel="stylesheet">
    <style>
        body{padding: 20px;}
        .demo-input{padding-left: 10px; height: 38px; min-width: 262px; line-height: 38px; border: 1px solid #e6e6e6;  background-color: #fff;  border-radius: 2px;}
        .bt_backcolor{
            background-color: gray;
        }
        .bt_backcolor:hover{
            background-color: gray !important;
        }
        .limit{
            background-color: gray;
            color: white;
            border-radius: 16px;
        }
    </style>
</head>
<include file="Admin@Index:cache" />
<body class="gray-bg contacts" oncopy="copyval()">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox">
                    <div class="ibox-content">
                        <h5>审核管理-
                            <small>待审核借款</small>
                        </h5>
                        <div class="col-sm-12" style="margin-bottom: 1rem">
                            <form role="form" id="my_form" action="__MODULE__/CheckManager/wait_check_borrow" method="get">
                                <div class="form-group">
                                    <input type="text" id="content" placeholder="" name="key" class="form-control" value="<{$search.key}>">
                                </div>
                                <div>
                                    <label>申请时间</label>
                                    <input style="height: 2.5rem;padding: 3px" type="text" class="demo-input" placeholder="选择时间" id="application_time" name="application_time" value="<{$search.application_time}>">
                                    <!--<label style="margin-left: 10px">借款时间</label>-->
                                    <!--<input style="height: 2.5rem;padding: 3px" type="text" class="demo-input"  placeholder="选择时间" id="borrow_time" name="borrow_time" value="<{$search.borrow_time}>">-->
                                    <!--<select class="form-control m-b" name="channel" id="select_channel" style="margin: 0px 10px 0px 10px;padding-top: 3px;display: inline;width: 11%;" >-->
                                        <!--<option value="">渠道商</option>-->
                                        <!--&lt;!&ndash;<option value="0">自增</option>&ndash;&gt;-->
                                        <!--<volist name="channel" id="vo">-->
                                            <!--<option value="<{$vo.chan_id}>"  ><{$vo.channel_name}></option>-->
                                        <!--</volist>-->
                                    <!--</select>-->
                                    <span>每页显示</span>
                                    <select onchange="submit_form()" class="form-control m-b" name="show_num"  id="show_num" style="margin-bottom: 0;padding-top: 3px;display: inline;width: 11%;" >
                                        <option value="10">10</option>
                                        <option value="20">20</option>
                                        <option value="50">50</option>
                                        <option value="100">100</option>
                                    </select>
                                    <span>条</span>
                                    <button class="btn btn-sm btn-primary pull-right m-t-n-xs" type="submit" id="search"><strong>搜索</strong>
                                    </button>
                                </div>
                            </form>
                        </div>
                        <br>
                        <div class="ibox-content">
                            <table class="table table-striped  table-hover" id="sample-table">
                                <tbody>
                                <tr>
                                    <th>ID</th>
                                    <th>用户手机号</th>
                                    <th>用户姓名</th>
                                    <th>借款单号</th>
                                    <th>借款金额</th>
                                    <th>授信金额</th>
                                    <th>申请时间</th>
                                    <th>出借人</th>

                                    <th>操作</th>
                                </tr>
                                <volist name="data" id="vo">
                                    <tr>
                                        <td><{$vo.user_id}></td>
                                        <td><{$vo.mobile}></td>
                                        <td><{$vo.username}></td>
                                        <td><{$vo.order_number}></td>
                                        <td><{$vo.loan_amount}></td>
                                        <td><{$vo.quota}></td>
                                        <td><{$vo.ctime}></td>
                                        <td><{$vo.lender}></td>


                                        <td id="th_<{$vs.id}>">
                                            <!--<a target="_blank" class="btn btn-success btn-rounded"-->
                                               <!--href="javascript:;" onclick="into_detail('<{$vo.user_id}>')"-->
                                               <!--title="详情">详情</a>-->
                                            <a target="_blank" class="btn btn-info btn-rounded"
                                               href="javascript:;" onclick="check('<{$vo.loan_id}>')"
                                               title="审核">审核</a>

                                            <!--<a class="btn btn-info btn-rounded"-->
                                                       <!--href="javascript:;" title="拉黑" onclick="user_borrow('<{$vo.user_id}>')"-->
                                                       <!--target="_blank">拉黑</a>-->
                                        </td>
                                    </tr>
                                </volist>
                                </tbody>
                            </table>
                        </div>
                        <ul class="pagination">
                                <{$fpage}>
                        </ul>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<!-- 全局js -->
<script src="__PUBLIC__/admin/js/jquery.min.js?v=2.1.4"></script>
<script src="__PUBLIC__/admin/js/bootstrap.min.js?v=3.3.6"></script>

<!-- 自定义js -->
<script src="__PUBLIC__/admin/js/content.js?v=1.0.0"></script>
<script src="__PUBLIC__/admin/js/laydate/laydate.js"></script>
<script src="__PUBLIC__/admin/js/layer/layer.js"></script>
<script src="__PUBLIC__/admin/js/layui/layui.js"></script>

<script>

    //审核
    function check(id) {

        console.log(id);
        html='';
        html+='<div class="modal-body" id="lists" style="height:80%">';
        html+='<form class="form-horizontal">';

        html+='<div class="form-group">';
        html+='<div class="col-sm-12"> <label>结果选择</label>';
        html+=' <select class="form-control m-b" name="channel" id="select_result" style="margin: 0px 10px 0px 10px;padding-top: 3px;display: inline;width: 80%;" > ' +
             ' <option  selected="selected" value="5" >通过</option> ' +
             ' <option value="4">拒绝</option> ' +
             '</select>';
        html+='</div> </div>' ;
//            ' <textarea   style="margin: 5px 0px 0px 25px;width: 70%" id="refuse_reason" placeholder="不通过原因"></textarea>';
//        html+='</div>';

        html+='</form>';
        html+='<div class="modal-footer" style="border:0">';
        html+='<a href="javascript:void(0);" onclick="layer.closeAll()" type="button" class="btn btn-default" >关闭</a>';
        html+='<a href="javascript:void(0);" onclick="check_loan(\''+id+'\');" type="button" class="btn btn-primary" >提交</a>';
        html+='</div>';
        html+='</div>';




        layer.open({
            type: 1, //Page层类型
            area: ['400px', '230px'],
            title: '借款审核',
            shade: 0.6, //遮罩透明度
            maxmin: true, //允许全屏最小化
            anim: 1, //0-6的动画形式，-1不开启
            content: html
        });

    }

//    //选项事件
//    $("#select_result").change(function(){
//        var opt=$("#select_result").val();
//        console.log('oo',opt);
//        if(opt=='4'){
//            $("#refuse_reason").style.display='inline';
//        }else {
//            $("#refuse_reason").style.display='none';
//        }
//    });


//审核
    function check_loan(loan_id) {
        var result=$('#select_result').val();
        if(result==''){
            layer.msg('请选择', {time: 2000, icon: 5});
            return false;
        }
        layer.confirm('确定操作？',function(){

            layer.load(2);
            $.post('__MODULE__/CheckManager/check_loan', { loan_id: loan_id,result:result}, function (data) {
                layer.closeAll('loading');
                if (data.code == '1001') {
                    window.location.reload();
                } else {

                        layer.msg(data.msg, {time: 2000, icon: 5});
                }
            });
        });
    }

    //表单提交
    function submit_form() {
        var form = document.getElementById('my_form');
        form.submit();
    }

    //select赋值
    var option2="<{$search.show_num}>";
    $('#show_num').val(option2);
    //select赋值
    var option="<{$search.channel}>";
    $('#select_channel').val(option);



    //用户详情
    function into_detail(id) {
        layer.load(4);
        window.location.href='__MODULE__/User/user_detail?u_id='+id;

        $.post('__MODULE__/User/user_detail', {u_id:id}, function (data) {
            layer.closeAll('loading');
        });
    }


    //日期时间范围
    laydate.render({
        elem: '#application_time'
        ,type: 'datetime'
        ,range: true
    });
    //日期时间范围
    laydate.render({
        elem: '#borrow_time'
        ,type: 'datetime'
        ,range: true
    });

//
//    $(document).ready(function () {
//        $('.fancybox').fancybox({
//            openEffect: 'none',
//            closeEffect: 'none'
//        });
//    });


    function copyval() {
//        event.returnValue = false;
        var content = '【已借款用户】列表复制：'+window.getSelection().toString();
        $.post('__MODULE__/Mypublic/copy_all', {content:content}, function (data) {
            if (data.code == '1001') {

            } else {
                console.log(data);
            }
        });
//        console.log(content)
    }
</script>


</body>

</html>
